package mrusanov.player

import mrusanov.terrain.TerrainType
import mrusanov.view.PlayerTypeView

class PlayerType(val name:String, val view:PlayerTypeView, hp:Double, damage:Double, val defence:Map[TerrainType, Int],
                 val damageType:DamageType, val resistances:DamageTypeResistance) {
  private val valueIncreasePerLevel = scala.math.pow(2d, 1/20d)
  private def levelUpValue(lvl:Int, value:Double) = (value * scala.math.pow(valueIncreasePerLevel, lvl - 1)).round.toInt

  def hp(level:Int) : Int = levelUpValue(level, hp)
  def damage(level:Int) : Int = levelUpValue(level, damage)
}




